package cumeo89.chii.client.entry.renderer;

import com.google.gwt.xml.client.Node;

import cumeo89.chii.client.entry.AbstractRenderer;
import cumeo89.chii.client.ui.TrivialPanel;

public class TextRenderer extends AbstractRenderer {

	private TrivialPanel text;
	
	public TextRenderer(String style) {
		text = new TrivialPanel("span");
		text.setStyleName(style);
		initWidget(text);
	}
	
	@Override
	public void prepareWidget(Node node, boolean selected) {
		super.prepareWidget(node, selected);
		text.setHTML(format(node.getNodeValue()));
	}

	protected String format(String value) {
		return value;
	}

}
